package cn.ucai.day01_Object.pa2_Orc;

import java.util.Random;
import java.util.Scanner;

public class TestOrc {

	public static void main(String[] args) {
		Orc orc=new Orc("食人怪",500,5);
		Random ran=new Random();
		orc.desc();
		Orc[] orcArr=new Orc[20];
		String[] nameArr={"食人怪","巫妖王","半兽人"};
		for(int i=0;i<orcArr.length;i++){
			int lvi=ran.nextInt(5)+1;
			int nidx=ran.nextInt(3);
			orcArr[i]=new Orc(nameArr[nidx],lvi*100,lvi);
		}
		for(int i=0;i<orcArr.length;i++){
			
			orcArr[i].desc();;
		}
		
		Scanner scan=new Scanner(System.in);
		System.out.println("请按1释放群攻，效果群体-300");
		int n=scan.nextInt();
		if(n==1){
			System.out.println("释放群攻");
			for(int i=0;i<orcArr.length;i++){
				if(orcArr[i].hp<=300){
					System.out.println(orcArr[i].name+"被秒杀了");
				}else{
					orcArr[i].hp-=300;
					orcArr[i].desc();
				}
			}
		}
	}

}
